const app = getApp()
import api from '../../tool/requestModel.js'
Page({
	data: {
		list: []
	},
	onLoad: function() {
		this.order()
	},
	order: function() {
		let optin_id = tt.getStorageSync('option_id')
		api.myOrder(optin_id)
			.then(res => {
				if (res.data.code == '200') {
					this.setData({
						list: res.data.data
					})
				}
			})
	},
	back: function() {
		tt.navigateBack()
	},
	remove: function(e) {
		let id = e.currentTarget.dataset.id
		api.removeOrder(id)
			.then(res => {
				if (res.data.code == '200') {
					this.order()
				}
			})
	}
})
